<?php

// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://demo.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | gitee 代码仓库：https://gitee.com/zoujingli/ThinkAdmin
// | github 代码仓库：https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\home\controller;

use app\company\service\DataService;
use library\Controller;
use think\Db;
use think\facade\Request;

/**
 * 企业员工管理
 * Class User
 * @package app\worker\controller
 */
class Config extends Controller
{
    /**
     * 基本参数配置
     * @auth true
     * @throws \think\Exception
     * @throws \think\exception\PDOException
     */
    public function config()
    {
        $this->title = '基本参数设定';
        $this->applyCsrfToken();
        if (Request::isGet()) {
            $this->fetch('config');
        }
        foreach (Request::post() as $key => $value) {
            sysconf($key, $value);
        }
        $this->success('系统参数配置成功！');
    }
}
